class Person {
  private _name: string
  private _age: number
  constructor(name: string, age: number) {
    this._name = name
    this._age = age
  }
  running() {
    console.log("running:", this._name)
  }
  public get name(): string {
    return this._name
  }

  public set name(v: string) {
    this._name = v;
  }


  public get age(): number {
    return this._age
  }

  public set age(v: number) {
    if (v >= 0 && v < 200) {
      this._age = v;
    }
  }
}

const p = new Person("why", 18)
console.log(p.name)
p.name = "kobe"
console.log(p.name)

p.age = -10
console.log(p.age)